CRMContainerBlock object
Use the CRMContainerBlock object to group blocks on a screen. It acts as a wrapper for other blocks. You can nest CRMContainerBlock inside other containers. An example of a container block is a linked search panel and related list.
A container block has standard Sage CRM buttons and any number of extra buttons. If any blocks with buttons are included, the buttons are shown only once on the container block and then applied to all the internal blocks. The standard CRM buttons are:
- Change or Save. Displayed as Change when the screen is in View mode and Save when the screen is Edit mode. This button is shown by default.
- Delete or Confirm Delete. Displayed as Delete when the screen is in View mode and Confirm Delete when the screen is in Confirm Delete mode. This button is not shown by default.
- Continue or Cancel. Displayed as Continue when the screen is in View mode and Cancel when the screen is in Edit or Confirm Delete mode. This button is not shown by default.
The Execute function on a block takes only one argument. When CRMContainerBlock is executed, it passes its argument to all its item blocks as they are executed. If item blocks in a container block require different arguments for their Execute functions, set the ArgObj property on each item block and don't pass any argument to the container.
Syntax to create a container with two blocks:
// Create a container.
Container = CRM.GetBlock("container");
// Get two screens.
Screen1 = CRM.GetBlock("Screen1");
Screen2 = CRM.GetBlock("Screen2");
// Add the screens to the container block.
Container.AddBlock(Screen1);
Container.AddBlock(Screen2);
// Display the container block, which displays the two blocks it contains.
CRM.AddContent(Container.Execute());
Response.Write(CRM.GetPage());